import http from "@/api";

/**
 * 评论列表
 */
export const commentListApi = (params: object) => {
    return http.get(`/comment/list`, params);
};

/**
 * 评论分页列表
 */
export const commentPageListApi = (params: object) => {
    return http.get(`/comment/paging`, params);
};

/**
 * 新增评论
 * @param params
 */
export const addCommentApi = (params: object) => {
    return http.post(`/comment/add`, params);
};

/**
 * 编辑评论
 * @param params
 */
export const editCommentApi = (params: any) => {
    return http.put(`/comment/edit/${params.id}`, params);
};

/**
 * 切换评论状态
 * @param id
 */
export const changeStatusApi = (id: number) => {
    return http.put(`/comment/change_status/${id}`);
};

/**
 * 修改排序
 * @param params
 */
export const changeSortApi = (params: object) => {
    return http.post(`/comment/changeSort`, params);
};

/**
 * 删除评论
 * @param id
 */
export const deleteCommentByIdApi = (id: number) => {
    return http.delete(`/comment/delete/${id}`);
};

/**
 * 批量删除
 * @param params
 */
export const deleteCommentApi = (params: object) => {
    return http.post(`/comment/delete`, params);
};
